package com.geeguo.ebuilder.client.business.system.excelimport.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.geeguo.ebuilder.client.business.system.excelimport.model.ExcelImportEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.Map;

@Mapper
public interface ExcelImportMapper extends BaseMapper<ExcelImportEntity> {

    IPage<ExcelImportEntity> list(Page<ExcelImportEntity> page, @Param("params") Map<String, Object> params);

    Integer countUnfinished(@Param("userId") String userId);

    Integer updatePending(@Param("id") String id);

    Integer updateProcessing(@Param("id") String id, @Param("startTime") Date startTime);

    Integer updateFinished(@Param("id") String id, @Param("endTime") Date endTime);

    Integer updateError(@Param("id") String id, @Param("errorMessage") String errorMessage);

    Integer updateCount(@Param("id") String id, @Param("successCount") Integer successCount, @Param("failCount") Integer failCount);
}